home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
math
/
nrpas13
/
bico.dem
< prev
next >
Wrap
Text File
|
1991-04-29
|
674b
|
29 lines
PROGRAM d6r3(input,output,dfile);
(* driver for routine BICO *)
VAR
binco : real;
i,k,n,nval : integer;
txt : string[21];
dfile : text;
gla : ARRAY [1..100] OF real;
(*$I MODFILE.PAS *)
(*$I GAMMLN.PAS *)
(*$I FACTLN.PAS *)
(*$I BICO.PAS *)
BEGIN
FOR i := 1 to 100 DO gla[i] := -1.0; (* initialize FACTLN *)
glopen(dfile,'fncval.dat');
REPEAT readln(dfile,txt) UNTIL (txt = 'Binomial Coefficients');
readln(dfile,nval);
writeln (txt);
writeln ('n':6,'k':6,'actual':12,'bico(n,k)':12);
FOR i := 1 to nval DO BEGIN
readln(dfile,n,k,binco);
writeln (n:6,k:6,binco:12:0,bico(n,k):12:0)
END
END.